package pack1;

public class java6 {
    public static void main(String[] args){
        double a=30;
        double b=7;
        double c=23;
        double answer;
        a=factorial(30);
        b=factorial(7);
        c=factorial(23);
        answer=a/(b*c);
        System.out.println("answer"+"="+(int)(answer+0.5));
    }
    public static double factorial(int n) {
        if (n < 0) {
            throw new IllegalArgumentException("输入必须是非负整数");
        }
        if (n == 0 || n == 1) {
            return 1;
        } else {
            return n * factorial(n - 1);
        }
    }
}
